﻿Imports Microsoft.VisualBasic
Imports System.Threading
Imports System.Globalization

' <summary>
' Custom base page used for all web forms.
' </summary>
Public Class BasePage
    Inherits System.Web.UI.Page
    Protected Overrides Sub InitializeCulture()

    'Set the UICulture and the Culture with a value stored in a Session-object. I called mine “MyCulture”
    If Not IsNothing(Session("MyCulture")) Then
      Thread.CurrentThread.CurrentUICulture = New CultureInfo(Session("MyCulture").ToString)
      Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session("MyCulture").ToString)
    End If
  End Sub
End Class

